package com.cetc.sidecar.client;

import com.alibaba.fastjson.JSON;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author zhangyc
 * @date Created on 2018年9月4日
 */
@RestController
public class JavaController {
    @Autowired
    private RestTemplate restTemplate;
    
    @RequestMapping("/sidecar-client")
    public String PythonUser() {
    	//test-sidecar为SideCar项目中的应用名字
    	//test为sidecar-server发布的微服务接口
        return restTemplate.getForEntity("http://test-sidecar/test", String.class).getBody();
    }
}
